package me.snowiest.snowdrift.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

@Data
@EqualsAndHashCode
@ApiModel(value = "资源")
@TableName("resource")
public class Resource implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("资源标识")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("资源名称")
    @TableField
    private String name;

    @ApiModelProperty("资源描述")
    private String description;

    @ApiModelProperty("资源后缀名")
    private String suffix;

    @ApiModelProperty("资源地址")
    private String url;

    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    @JSONField(serialize = false)
    private LocalDateTime creationTime;

    @TableField(value = "gmt_modified", fill = FieldFill.INSERT_UPDATE)
    @JSONField(serialize = false)
    private LocalDateTime modificationTime;

    @TableLogic
    @JSONField(serialize = false)
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    @Version
    @JSONField(serialize = false)
    @TableField(fill = FieldFill.INSERT)
    private Integer version;
}
